package bundle;
import net.pimpas.resourcebundle.exception.MessageKeyNotFoundException;
import net.pimpas.resourcebundle.exception.ResourceBundleNotFoundException;
import net.pimpas.resourcebundle.serviceprovider.ResourceBundleServiceProvider;
import net.pimpas.resourcebundle.serviceprovider.ResourceBundleServiceProviderFactoryImpl;
import net.pimpas.resourcebundle.serviceprovider.ResourceBundleServiceProviderNameAnnotation;
import net.pimpas.resourcebundle.serviceprovider.ResourceBundleServiceProviderType;
@ResourceBundleServiceProviderNameAnnotation(value = "bundle.CustomMessages", defaultResource=false)
public class ResourceBundleTest {
	
	public static void main(String[] args) {
		ResourceBundleServiceProvider bundle = ResourceBundleServiceProviderFactoryImpl.getResourceBundleServiceProvider();
		
		// try another
		ResourceBundleServiceProvider bundle2 = ResourceBundleServiceProviderFactoryImpl.getResourceBundleServiceProvider();
		
		try {
			System.out.println(bundle.getMessage(ResourceBundleTest.class, "hello", ResourceBundleServiceProviderType.INFO, "CASMA"));
			System.out.println(bundle2.getMessage(ResourceBundleTest.class, "hello", ResourceBundleServiceProviderType.NULL, "casma"));
		} catch (ResourceBundleNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MessageKeyNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}